package com.sqlcheck.dto.request;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

@Data
@Schema(description = "测试数据库连接请求")
public class TestDatabaseConnectionRequest {

    @NotBlank(message = "数据库主机地址不能为空")
    @Schema(description = "数据库主机地址", example = "localhost", required = true)
    private String host;

    @NotNull(message = "数据库端口不能为空")
    @Schema(description = "数据库端口", example = "3306", required = true)
    private Integer port;

    @NotBlank(message = "数据库名称不能为空")
    @Schema(description = "数据库名称", example = "test_db", required = true)
    private String database;

    @Schema(description = "Schema名称", example = "public")
    private String schema;

    @NotBlank(message = "数据库用户名不能为空")
    @Schema(description = "数据库用户名", example = "db_user", required = true)
    private String username;

    @NotBlank(message = "数据库密码不能为空")
    @Schema(description = "数据库密码", example = "db_password", required = true)
    private String password;

    @NotBlank(message = "数据库类型不能为空")
    @Schema(description = "数据库类型", example = "MYSQL", required = true, allowableValues = { "MYSQL", "ORACLE" })
    private String dbType;

    @Schema(description = "Oracle连接方式", example = "SERVICE_NAME", allowableValues = { "SERVICE_NAME", "SID" })
    private String oracleConnectionType = "SERVICE_NAME";
}